package DynamicProxy;

import DynamicProxy.entity.ApiTime;
import DynamicProxy.interfaceDemo.Api;
import DynamicProxy.proxyDemo.ApiTimeProxy;

import java.lang.reflect.Proxy;

/**
 * create by mwh 2021-11-12
 **/

public class ClientApiProxy {
    public static void main(String[] args) throws InterruptedException {
     Api apiTime =  (Api) Proxy.newProxyInstance(
                ApiTime.class.getClassLoader(),
                ApiTime.class.getInterfaces(),
                new ApiTimeProxy(new ApiTime())
        );
     apiTime.getApiTime();
    }
}
